package smartcrud.spring.controllers.cms.editor;

import java.beans.PropertyEditorSupport;

import smartcrud.spring.models.cms.Attachment;
/**
 * @author cyper.yin
 *
 */
public class AttachmentEditor extends PropertyEditorSupport {
	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		if (text != null) {
			Attachment att = new Attachment();
			att.setId(Integer.valueOf(text));
			setValue(att);
		} else {
			setValue(null);
		}
	}
}
